#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import os
import tkinter as tk
from tkinter import ttk

import utils

# 颜色
COLOR_BLACK = "#000000"
COLOR_GRAY = "#B9BFC1"
COLOR_GREEN = '#009051'
COLOR_RED = '#ff5643'
COLOR_TXT_BG = "#ECECEC"
COLOR_LIST_BG = "#EFEFEF"


__assets = os.path.join(utils.exe_parent, "assets")
img_win_icon = os.path.join(__assets, 'icon.ico')
# img_win_icon = os.path.join(__assets, 'icon_512.png')

# dock_icon
img_mac_icon = os.path.join(__assets, 'icon_256.gif')


def init_style():
    # 新增一个ttk样式
    style = ttk.Style()
    style.configure("Red.TLabel", foreground=COLOR_RED)


def config_label_red(widget):
    widget.configure(style="Red.TLabel")


def get_small_format():
    families = tk.font.families()
    font_name = '微软雅黑' if utils.is_windows else ''
    font_size = 8 if utils.is_windows else 10
    if families.count(font_name):
        txt_format = tk.font.Font(size=font_size, family=font_name)
    else:
        txt_format = tk.font.Font(size=font_size)
    return txt_format


def get_big_title():
    families = tk.font.families()
    font_name = '微软雅黑' if utils.is_windows else ''
    font_size = 16 if utils.is_windows else 14
    if families.count(font_name):
        txt_format = tk.font.Font(size=font_size, family=font_name)
    else:
        txt_format = tk.font.Font(size=font_size)
    return txt_format

# LIST_WIDTH = 91+10
# TXT_WIDTH = 78
# FILE_GAP = 65+10
# WRAP_LENGTH = 780
